import request from "../common/request"

/**
 * @param data:Object {code,phonenumber}
 */
export const phoneLogin = data => {
  return request('/mailbox/phoneLogin', data, 'post')
}

export const userNameLogin = data => {
  return request('/mailbox/userNameLogin', data, 'post')
}
/**
 * @param data:Object {wechat,nickName}
 */
export const wxLogin = data => {
  return request('/mailbox/wx/appletLogin', data, 'post')
}

export const wxPhoneLogin = data => {
  return request('/mailbox/appletPhoneLogin', data, 'post')
}

export const getUnionIdByCode = data => {
  return request('/mailbox/check/wxGetUnionId', data)
}

export const addCollect = data => {
  return request('/mailbox/collect', data, 'post')
}

export const getCollectList = data => {
  return request('/mailbox/collect/list', data)
}

export const deleteCollects = data => {
  return request('/mailbox/collect/delete', data)
}
export const resettingEnabled = data => {
  return request('/resettingEnabled', data, 'post')
}

export const isItEnabled = data => {
  return request('/isItEnabled', data, 'post')
}

export const getUserInfo = id => {
  return request('/system/user/userId', {
    userId: id
  })
}

export const updateUser = data => {
  return request('/system/user/updateUser',data,'post')
}

export const getSmsCode = data => {
  return uni.request({
    url: 'https://blms-admin.xllibrary.com/send/' + data,
  })
}